<%@ page import="com.cnc.service.Impl.StudentServiceImpl" %>
<%@ page import="com.cnc.entity.Student" %>
<%@ page import="com.cnc.utils.ResourceUtil" %><%--
  Created by IntelliJ IDEA.
  User: finder
  Date: 2021/10/16
  Time: 10:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理系统-详细信息</title>
    <style type="text/css">
        form{
            width: 400px;
            height: 400px;
            border: 1px black solid;
            text-align: center;
            margin: auto;
        }
    </style>
</head>
<body>
<form action="StudentServlet" method="post" enctype="multipart/form-data">
    <%
        String sid = request.getParameter("sid");
        StudentServiceImpl Service = new StudentServiceImpl();
        Student s = Service.getStudentBySid(sid);
    %>
    <input type="hidden" name="flag" value="edit">
    <input type="hidden" name="sid" value="<%=s.getSid()%>">
    <input type="hidden" name="oldPhoto" value="<%=s.getPhoto()%>">
    <h1>学生管理系统-编辑学生</h1>
    姓名：<input type="text" name="sname" value="<%=s.getSname()%>"><br><br>
    年龄：<input type="text" name="sage" value="<%=s.getSage()%>"><br><br>
    性别：
    <input type="radio" name="sgender" value="男" <%=s.getSgender().equals("男")?"checked":""%>>男
    <input type="radio" name="sgender" value="女" <%=s.getSgender().equals("女")?"checked":""%>>女<br><br>
    邮箱：<input type="text" name="semail" value="<%=s.getSemail()%>"><br><br>
    照片：<input type="file" name="photo">
    <img src="../<%=ResourceUtil.getPath()%>/<%=s.getPhoto()%>" width="50"> <br><br>
    <input type="submit" value="修改">
</form>
</body>
</html>
